from django.urls import path
from django.conf.urls import url
from . import views
from rest_framework.urlpatterns import format_suffix_patterns

urlpatterns = [
    # path('', views.index, name='index'),
    path('<int:id>/test', views.test),
    path('<str:aaa>/test', views.test2),

    # url('^test3', views.test3),
    url(r'^blog/$', views.index),
    url(r'^blog/product/$', views.product),
    url(r'^blog/product/(?P<pk>[0-9]+)$', views.product_detail),

    #基于类的视图
    url(r'^blog/productList/$', views.ProductList.as_view()),

    #using mix
    url(r'^blog/productListMix/$', views.ProductListMix.as_view()),

    #using generics
    url(r'^blog/productListGen/$', views.ProductListGen.as_view()),

    #product detail using generics
    url(r'^blog/productDetailGen/(?P<pk>[0-9]+)$', views.ProductDetailGen.as_view()),

    #分页
    # re_path('(?P<version>[v1|v2]+)/page1/', Pager1View.as_view(), )


]

# urlpatterns = format_suffix_patterns(urlpatterns)
